package com.neteast.androidclient.contact.util;

import com.neteast.androidclient.contact.Constant;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class LoginUtil {
	private LoginUtil(){}
	
	public static void setLastLoginUserId(Context context,String userId) {
		SharedPreferences sp = context.getSharedPreferences(Constant.SP_CONFIG_FILE_NAME, Context.MODE_PRIVATE);
		Editor edit = sp.edit();
		edit.putString(Constant.SP_USER_ID, userId);
		edit.commit();
	}
	
	public static String getLastLoginUserId(Context context) {
		SharedPreferences sp = context.getSharedPreferences(Constant.SP_CONFIG_FILE_NAME, Context.MODE_PRIVATE);
		return sp.getString(Constant.SP_USER_ID, 0+"");
	}
}
